import Vue from 'vue'
import Router from 'vue-router'
// import HelloWorld from '@/components/HelloWorld'
import Home from '@/views/index'
import Notice from '@/views/notice/notice.vue'
import My from '@/views/my/my.vue'

const Login = r => require.ensure([], () => r(require('@/views/passport/login.vue')), 'pages/passport/login')
const Register = r => require.ensure([], () => r(require('@/views/passport/register.vue')), 'pages/passport/register')
const Forget = r => require.ensure([], () => r(require('@/views/passport/forget.vue')), 'pages/passport/forget')
const Order = r => require.ensure([], () => r(require('@/views/order/list.vue')), 'pages/order/list') // 订单列表
const OrderDetail = r => require.ensure([], () => r(require('@/views/order/detail.vue')), 'pages/order/detail') // 订单详情
const SendSet = r => require.ensure([], () => r(require('@/views/order/send.vue')), 'pages/order/send') // 订单发货
const Users = r => require.ensure([], () => r(require('@/views/user/list.vue')), 'pages/user/list') // 用户列表
const Verification = r => require.ensure([], () => r(require('@/views/verification/list.vue')), 'pages/verification/list') // 核销列表
const Setting = r => require.ensure([], () => r(require('@/views/my/setting.vue')), 'pages/my/setting') // 设置
const NoticeAdd = r => require.ensure([], () => r(require('@/views/notice/add.vue')), 'pages/notice/add') // 发布公告
const GoodList = r => require.ensure([], () => r(require('@/views/good/list.vue')), 'pages/good/list') // 商品管理
const UserList = r => require.ensure([], () => r(require('@/views/user/list.vue')), 'pages/user/list') // 用户列表
const Bargain = r => require.ensure([], () => r(require('@/views/activity/bargain.vue')), 'pages/activity/bargain') // 砍价管理
const BargainEdit = r => require.ensure([], () => r(require('@/views/activity/bargain_edit.vue')), 'pages/activity/bargain_edit') // 砍价编辑
const Group = r => require.ensure([], () => r(require('@/views/activity/group.vue')), 'pages/activity/group') // 拼团管理
const GroupEdit = r => require.ensure([], () => r(require('@/views/activity/group_edit.vue')), 'pages/activity/group_edit') // 拼团编辑
const Seckill = r => require.ensure([], () => r(require('@/views/activity/seckill.vue')), 'pages/activity/seckill') // 秒杀管理
const SeckillEdit = r => require.ensure([], () => r(require('@/views/activity/seckill_edit.vue')), 'pages/activity/seckill_edit') // 秒杀编辑
const UserEdit = r => require.ensure([], () => r(require('@/views/user/edit.vue')), 'pages/user/edit') // 用户编辑
const SetPwd = r => require.ensure([], () => r(require('@/views/my/setpwd.vue')), 'pages/my/setpwd') // 设置密码
const MemberEdit = r => require.ensure([], () => r(require('@/views/my/member_edit.vue')), 'pages/my/member_edit') // 商家编辑
const DistributionSet = r => require.ensure([], () => r(require('@/views/my/distribution_set.vue')), 'pages/my/distribution_set') // 分销设置
const ManagerSet = r => require.ensure([], () => r(require('@/views/my/manager_set.vue')), 'pages/my/manager_set') // 管理员设置
const ManagerEdit = r => require.ensure([], () => r(require('@/views/my/manager_edit.vue')), 'pages/my/manager_edit') // 管理员编辑
const ManagerAdd = r => require.ensure([], () => r(require('@/views/my/manager_add.vue')), 'pages/my/manager_add') // 新增管理员
const MiniAppSet = r => require.ensure([], () => r(require('@/views/my/mini_app_set.vue')), 'pages/my/mini_app_set') // 小程序设置
const MiniAppEdit = r => require.ensure([], () => r(require('@/views/my/mini_app_edit.vue')), 'pages/my/mini_app_edit') // 小程序设置
const LogisticsSet = r => require.ensure([], () => r(require('@/views/order/logistics.vue')), 'pages/order/logistics') // 物流详情
const Editor = r => require.ensure([], () => r(require('@/views/activity/editor.vue')), 'pages/activity/editor') // 编辑
const GoodOperate = r => require.ensure([], () => r(require('@/views/good/operate.vue')), 'pages/good/operate') // 商品发布、编辑
const GoodOperateEdit = r => require.ensure([], () => r(require('@/views/good/operate_edit.vue')), 'pages/good/operate_edit') // 商品发布、编辑
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: 'good/operate',
      name: 'good-operate',
      component: GoodOperate
    },
    {
      path: '/',
      name: 'Home',
      component: Home
    },
    {
      path: '/notice/notice',
      name: 'notice-notice',
      component: Notice
    },
    {
      path: '/my/my',
      name: 'my-my',
      component: My
    },
    {
      path: '/passport/register',
      name: 'passport-register',
      component: Register
    },
    {
      path: '/passport/forget',
      name: 'passport-forget',
      component: Forget
    },
    {
      path: '/passport/login',
      name: 'passport-login',
      component: Login
    },

    {
      path: '/order/detail',
      name: 'order-detail',
      component: OrderDetail
    },
    {
      path: '/order/send',
      name: 'order-send',
      component: SendSet
    },
    {
      path: '/user/list',
      name: 'user-list',
      component: Users
    },
    {
      path: '/verification/list',
      name: 'verification-list',
      component: Verification
    },
    {
      path: '/my/setting',
      name: 'my-setting',
      component: Setting
    },
    {
      path: '/notice/add',
      name: 'notice-add',
      component: NoticeAdd
    },
    {
      path: '/good/list',
      name: 'good-list',
      component: GoodList
    },
    {
      path: '/user/list',
      name: 'user-list',
      component: UserList
    },
    {
      path: '/activity/bargain',
      name: 'activity-bargain',
      component: Bargain
    },
    {
      path: '/activity/group',
      name: 'activity-group',
      component: Group
    },
    {
      path: '/activity/seckill',
      name: 'activity-seckill',
      component: Seckill
    },

    {
      path: '/user/edit',
      name: 'user-edit',
      component: UserEdit
    },
    {
      path: '/my/setpwd',
      name: 'my-setpwd',
      component: SetPwd
    },
    {
      path: '/my/member_edit',
      name: 'my-member_edit',
      component: MemberEdit
    },
    {
      path: '/my/distribution_set',
      name: 'my-distribution_set',
      component: DistributionSet
    },
    {
      path: '/my/manager_set',
      name: 'my-manager_set',
      component: ManagerSet
    },
    {
      path: '/my/manager_edit',
      name: 'my-manager_edit',
      component: ManagerEdit
    },
    {
      path: '/my/manager_add',
      name: 'my-manager_add',
      component: ManagerAdd
    },
    {
      path: '/my/mini_app_set',
      name: 'my-mini_app_set',
      component: MiniAppSet
    },
    {
      path: '/my/mini_app_edit',
      name: 'my-mini_app_edit',
      component: MiniAppEdit
    },
    {
      path: '/activity/bargain_edit',
      name: 'activity-bargain_edit',
      component: BargainEdit
    },
    {
      path: '/activity/editor',
      name: 'activity-editor',
      component: Editor
    },
    {
      path: '/order/logistics',
      name: 'order-logistics',
      component: LogisticsSet
    },
    {
      path: 'order/list',
      name: 'order-list',
      component: Order
    },
    {
      path: 'activity/group_edit',
      name: 'activity-group_edit',
      component: GroupEdit
    },
    {
      path: 'activity/seckill_edit',
      name: 'activity-seckill_edit',
      component: SeckillEdit
    },
    {
      path: 'good/operate_edit',
      name: 'good-operate_edit',
      component: GoodOperateEdit
    }
  ]
})
